#pragma once

#include <memory>
#include <string>

#include "ocrlite_port.hpp"
#include "ocr_struct.hpp"

namespace cv
{
	class Mat;
}
class OcrLite;

class OCRLITE_PORT OcrLiteCaller
{
public:
	OcrLiteCaller();
	~OcrLiteCaller() = default;

	OcrLiteCaller(const OcrLite&) = delete;
	OcrLiteCaller(OcrLite&&) = delete;

	OcrLiteCaller& operator=(const OcrLiteCaller&) = delete;
	OcrLiteCaller& operator=(OcrLiteCaller&&) = delete;

	void setNumThread(int numOfThread);

	bool initModels(const std::string& detPath, const std::string& clsPath,
		const std::string& recPath, const std::string& keysPath);

	OcrResult detect(const cv::Mat& mat,
		int padding, int maxSideLen,
		float boxScoreThresh, float boxThresh, float unClipRatio, bool doAngle, bool mostAngle);

	OcrResult detect(const std::string& dir, const std::string& file,
		int padding, int maxSideLen,
		float boxScoreThresh, float boxThresh, float unClipRatio, bool doAngle, bool mostAngle);

private:
	std::shared_ptr<OcrLite> m_ocrlite_ptr;
};
